package com.itheima.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.reggie.dto.SetmealDto;
import com.itheima.reggie.pojo.Setmeal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SetmealMapper extends BaseMapper<Setmeal> {

    //分页条件查询，包括分类名称
    //@Select("select s.*, c.name categoryName from setmeal s, category c where s.category_id = c.id")
    Page<SetmealDto> pageSetmealDto(@Param("page") Page<SetmealDto> pageInfo,
                                    @Param("name") String name);

    //根据id查询套餐详情信息，包括套餐关联的菜品集合，一对多查询
    SetmealDto findById(Long id);
}


